<?php


namespace app\cms\community\thirdPartyApi\weChat\lib;


use app\cms\community\thirdPartyApi\abstracts\Config;
use iflow\Utils\basicTools;

class payParams extends Config
{
    // 支付内容
    public string $body;
    // 支付金额
    public float $total_fee;
    // openid
    public string $open_id = "";

    public string $out_trade_no;

    public string $spbill_create_ip;

    public string $currency = "CNY";

    /**
     * @throws \Exception
     */
    public function __construct(int $type = 0, int $id = 0) {
        parent::__construct($type, $id);
        $this->config['mchid'] = $this->config['mch_id'] ?? '';
        $this->out_trade_no = (new basicTools())->make_order();
        $this->spbill_create_ip = request()->ip();
    }
}